for i in range(100,1000):
    i2=i//100
    i1=(i//10)%10
    i0=i%10
    if i==i2*i2*i2+i1*i1*i1+i0*i0*i0:
        print('%d'%i,end=' ')